<include file="Index/header" />
    <!--sidebar left start-->
    <include file="Index/nav" />
    <!--左侧栏 end-->
    <!--主内容 start-->
    <section class="main-content-wrapper">
        <section id="main-content">
            
            <div class="row">
                    <div class="col-md-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">推荐内容列表</h3>
                                <div class="actions pull-right">
                                    <i class="fa fa-chevron-down"></i>
                                    <i class="fa fa-times"></i>
                                </div>
                            </div>
                            <div class="panel-body"> 
                            	<div class="row">
								  <div class="col-lg-6">
								    	<form action="/admin.php" method="get">
								    <div class="input-group">
									    	<span class=" input-group-btn "><button class="btn btn-disable" type="button">推荐位</button></span>
									    	<select name="position_id" class="form-control ">
												<option value="">全部推荐位</option>
									    		<foreach name="positionnames" item="positionname">
													<option value="{$positionname.id}" <if condition="$position_id eq $positionname['id']">selected="selected"</if> >{$positionname.name}</option>
									    		</foreach>
											</select>

											<input type="hidden" name="c" value="PositionContent" />
											<input type="hidden" name="a" value="index" />
										    <span class="input-group-btn">
										       <button class="btn btn-primary" type="submit">搜索</button>
										    </span>
											<input class="form-control" type="text" name="title" id="title" value="{$title}"  placeholder="标题"/>
								    </div><!-- /input-group -->
								    	</form>
								  </div><!-- /.col-lg-6 -->
								  
								  <div class="col-lg-6">
	                            	<button id="cs_add_news_btn" type="button" class="btn btn-primary"><i class="fa  fa-plus"></i>添加</button>	
								  </div>	
								</div><!-- /.row -->

                            	<form id="cs_listorder_form">
                                <table id="example" class="table cs_menu_table table-striped table-bordered" cellspacing="0" width="100%">
                                    <thead>
                                        <tr>
                                        	<th width="50px">排序</th>
                                            <th>id</th>
                                            <th>推荐位</th>
                                            <th>标题</th>
                                            <th>广告图</th>
                                            <th>链接</th>
                                            <th>文章id</th>
                                            <th>状态</th>
                                            <th>时间</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>

                                    <tbody>
                                    <volist name="positionsContent" id="posiCont">
                                        <tr>
                                        	<td><input size="1" type="text" name="listorder[{$posiCont.id}]" value="{$posiCont.listorder}" /></td>
                                            <td>{$posiCont.id}</td>
                                            <td>{$posiCont.position_id|getPositionName=$positionnames,###}</td>
                                            <td>{$posiCont.title|substr_cut=12,###}</td>
                                            <td>{$posiCont.thumb|isthumb}</td>
                                            <td>{$posiCont.url}</td>
                                            <td>{$posiCont.news_id}</td>
                                            <td>{$posiCont.status|status}</td>
                                            <td>{$posiCont.create_time|date="Y-m-d H:i",###}</td>
                                            <td><span class="btn btn-primary btn-xs" attr-id="{$posiCont.id}" id="edit"><i class="fa fa-edit"></i></span>&nbsp;&nbsp;<span class="btn btn-danger btn-xs" attr-id="{$posiCont.id}" attr-message="删除？" id="del"><i class="fa fa-trash-o"></i></span></td>
                                        </tr>
                                    	
                                    </volist>
                                      
                                       
                                    </tbody>
                                </table>
                                <nav>
                                	<ul class="pagination">
                                		{$pageRes}
                                	</ul>
                                </nav>
								<div class="col-lg-6">
	                            	<button id="cs_listorder_btn" type="button" class="btn btn-primary"><i class="fa fa-sort-numeric-desc"></i>更新排序</button>	
								</div>
								</form>
								
                            </div>
                        </div>
                    </div>
                </div>
          
            
        </section>
    </section>
    <!--主内容区 end-->
    <script src="/Public/js/admin/position.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
    	var SCOPE={
			'add_url':'/admin.php?c=PositionContent&a=add',
			'edit_url':'/admin.php?c=PositionContent&a=edit',
			'del_url':'/admin.php?c=PositionContent&a=del',
			'jump_url':'/admin.php?c=PositionContent&a=index',
			'listorder_url':'/admin.php?c=PositionContent&a=listorder',
			'ajax_upload_img_url':'/admin.php?c=image&a=save',
			
		}
    	
    	
    	
    </script>
        
<include file="Index/footer" />